package com.yuda.campsite.service.impl;

import java.util.Date;
import java.util.List;
import java.util.Map;

import com.yuda.campsite.domain.CampsiteConf;
import com.yuda.campsite.mapper.CampsiteConfMapper;
import com.yuda.campsite.service.ICampsiteConfService;
import com.yuda.common.core.utils.DateUtils;
import com.yuda.common.core.web.domain.AjaxResult;
import org.apache.ibatis.annotations.Param;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
 * 【请填写功能名称】Service业务层处理
 *
 * @author wyn
 * @date 2021-09-23
 */
@Service
public class CampsiteConfServiceImpl implements ICampsiteConfService
{
    @Resource
    private CampsiteConfMapper campsiteConfMapper;

    /**
     * 查询【请填写功能名称】
     *
     * @param id 【请填写功能名称】ID
     * @return 【请填写功能名称】
     */
    @Override
    public CampsiteConf selectCampsiteConfById(Long id)
    {
        return campsiteConfMapper.selectCampsiteConfById(id);
    }

    /**
     * 查询【请填写功能名称】列表
     *
     * @param campsiteConf 【请填写功能名称】
     * @return 【请填写功能名称】
     */
    @Override
    public List<CampsiteConf> selectCampsiteConfList(CampsiteConf campsiteConf)
    {
        return campsiteConfMapper.selectCampsiteConfList(campsiteConf);
    }

    /**
     * 新增【请填写功能名称】
     *
     * @param campsiteConf 【请填写功能名称】
     * @return 结果
     */
    @Override
    public int insertCampsiteConf(CampsiteConf campsiteConf)
    {
        campsiteConf.setCreateTime(DateUtils.getNowDate());
        return campsiteConfMapper.insertCampsiteConf(campsiteConf);
    }

    /**
     * 修改【请填写功能名称】
     *
     * @param campsiteConf 【请填写功能名称】
     * @return 结果
     */
    @Override
    public int updateCampsiteConf(CampsiteConf campsiteConf)
    {
        campsiteConf.setUpdateTime(DateUtils.getNowDate());
        return campsiteConfMapper.updateCampsiteConf(campsiteConf);
    }

    /**
     * 批量删除【请填写功能名称】
     *
     * @param ids 需要删除的【请填写功能名称】ID
     * @return 结果
     */
    @Override
    public int deleteCampsiteConfByIds(Long[] ids)
    {
        return campsiteConfMapper.deleteCampsiteConfByIds(ids);
    }

    /**
     * 删除【请填写功能名称】信息
     *
     * @param id 【请填写功能名称】ID
     * @return 结果
     */
    @Override
    public int deleteCampsiteConfById(Long id)
    {
        return campsiteConfMapper.deleteCampsiteConfById(id);
    }

    @Override
    public List<CampsiteConf> xuanZhe(Map<String, Object>params, String onOff,  String name) {
        return campsiteConfMapper.xuanZhe(params,onOff,name);
    }

    @Override
    public int kaiqi(String onOff, String name) {
         return  campsiteConfMapper.kaiqi(onOff, name);

    }

    @Override
    public int guanbi(String onOff, String name) {
       return campsiteConfMapper.guanbi(onOff, name);

    }

    @Override
    public Integer BaoMingSuccess() {
        return campsiteConfMapper.BaoMingSuccess();
    }

    @Override
    public List<String> yingdiName() {
        return campsiteConfMapper.yingdiName();
    }


    @Override
    public String nameExists(CampsiteConf campsiteConf) {
        return campsiteConfMapper.nameExists(campsiteConf);
    }

    @Override
    public Integer tombstone(Long id) {
        return campsiteConfMapper.tombstone(id);
    }

    @Override
    public List<Integer> getCampIdByDetpId(Long deptId) {
        return campsiteConfMapper.getCampIdByDetpId(deptId);
    }

    @Override
    public String SelectPhone(String idCard) {
        return campsiteConfMapper.SelectPhone(idCard);
    }

    @Override
    public String SelectName(String idCard) {
        return campsiteConfMapper.SelectName(idCard);
    }

    @Override
    public String SelectYingDiName(String campsiteId) {
        return campsiteConfMapper.SelectYingDiName(campsiteId);
    }

    @Override
    public String getRegistrationFee(String name, Integer campsiteId) {
        return campsiteConfMapper.getRegistrationFee(name,campsiteId);
    }




}
